home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Hyper / I-J / ICON Buttons.cpt / ICON Buttons / card_4839.txt < prev    next >
Text File  |  1990-12-13  |  14KB  |  444 lines

  1. -- card: 4839 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 2860
  5. -- name: ICON Buttons
  6. ----- HyperTalk script -----
  7. on openStack
  8.   repeat until the mouseclick
  9.     set visible of card field "pt" to true
  10.     wait for 45 ticks
  11.     set visible of card field "pt" to false
  12.     wait for 15 ticks
  13.   end repeat
  14. end openStack
  15.  
  16. on closecard
  17.   set visible of card field "pt" to false
  18. end closeCard
  19.  
  20. on openCard
  21.   set the scroll of card field "info" to 0
  22. end openCard
  23.  
  24.  
  25. -- part 3 (field)
  26. -- low flags: 81
  27. -- high flags: 2004
  28. -- rect: left=139 top=21 right=42 bottom=359
  29. -- title width / last selected line: 0
  30. -- icon id / first selected line: 0 / 0
  31. -- text alignment: 0
  32. -- font id: 3
  33. -- text size: 9
  34. -- style flags: 0
  35. -- line height: 12
  36. -- part name: pt
  37.  
  38.  
  39. -- part 6 (field)
  40. -- low flags: 00
  41. -- high flags: 2007
  42. -- rect: left=40 top=54 right=215 bottom=472
  43. -- title width / last selected line: 0
  44. -- icon id / first selected line: 0 / 0
  45. -- text alignment: 0
  46. -- font id: 3
  47. -- text size: 10
  48. -- style flags: 0
  49. -- line height: 13
  50. -- part name: Info
  51. ----- HyperTalk script -----
  52. on mousewithin
  53.   --
  54.   --hypertext technique by Steve Drazga, ART Incorporated
  55.   --if you use this in your scripts please include these 2 lines.
  56.   --
  57.   --
  58.   --edited by Mark Spaulding
  59.   --
  60.   global selectedWord
  61.  
  62.   if selection is not empty then  --something was selected
  63.     put selection into SelectedWord
  64.     if space is in selection then  --the user selected more than 1 word
  65.       click at loc of target       --so we will clear the selection
  66.       exit mousewithin             --and exit to wait for another selection
  67.     end if
  68.     --check to see if word is in index field
  69.     if selectedWord = word 1 of card field "index" or selectedWord = word 2 of card field "index" or selectedWord = word 3 of card field "index" or selectedWord = word 4 of card field "index" or selectedWord = word 5 of card field "index" or selectedWord = word 6 of card field "index" or selectedWord = word 7 of card field "index" then
  70.       set visible of card field selectedWord to true
  71.       click at loc of target       --so we will clear the selection
  72.     else
  73.       click at loc of target --so we will clear the selection
  74.       beep
  75.       answer quote&selectedword"e&&"didn‚Äôt have an asterisk." with "oops!"
  76.     end if
  77.   end if
  78. end mousewithin
  79.  
  80.  
  81.  
  82.  
  83. -- part 8 (field)
  84. -- low flags: 80
  85. -- high flags: 0002
  86. -- rect: left=314 top=199 right=337 bottom=483
  87. -- title width / last selected line: 0
  88. -- icon id / first selected line: 0 / 0
  89. -- text alignment: 0
  90. -- font id: 3
  91. -- text size: 12
  92. -- style flags: 0
  93. -- line height: 16
  94. -- part name: index
  95.  
  96.  
  97. -- part 9 (field)
  98. -- low flags: 81
  99. -- high flags: 2004
  100. -- rect: left=157 top=71 right=119 bottom=363
  101. -- title width / last selected line: 0
  102. -- icon id / first selected line: 0 / 0
  103. -- text alignment: 0
  104. -- font id: 3
  105. -- text size: 9
  106. -- style flags: 256
  107. -- line height: 12
  108. -- part name: edited
  109. ----- HyperTalk script -----
  110. on mouseDown
  111.   set visible of card field "edited" to not the visible of card field "edited"
  112. end mouseDown
  113.  
  114.  
  115. -- part 11 (field)
  116. -- low flags: 81
  117. -- high flags: 2004
  118. -- rect: left=326 top=210 right=283 bottom=481
  119. -- title width / last selected line: 0
  120. -- icon id / first selected line: 0 / 0
  121. -- text alignment: 0
  122. -- font id: 3
  123. -- text size: 9
  124. -- style flags: 256
  125. -- line height: 12
  126. -- part name: Spaulding
  127. ----- HyperTalk script -----
  128. on mouseDown
  129.   set visible of card field "Spaulding" to not the visible of card field "Spaulding"
  130. end mouseDown
  131.  
  132.  
  133. -- part 12 (field)
  134. -- low flags: 81
  135. -- high flags: 2004
  136. -- rect: left=39 top=172 right=316 bottom=147
  137. -- title width / last selected line: 0
  138. -- icon id / first selected line: 0 / 0
  139. -- text alignment: 0
  140. -- font id: 3
  141. -- text size: 9
  142. -- style flags: 256
  143. -- line height: 12
  144. -- part name: Tools
  145. ----- HyperTalk script -----
  146. on mouseDown
  147.   set visible of card field "Tools" to not the visible of card field "Tools"
  148. end mouseDown
  149.  
  150.  
  151. -- part 13 (field)
  152. -- low flags: 81
  153. -- high flags: 2004
  154. -- rect: left=336 top=25 right=328 bottom=495
  155. -- title width / last selected line: 0
  156. -- icon id / first selected line: 0 / 0
  157. -- text alignment: 0
  158. -- font id: 3
  159. -- text size: 9
  160. -- style flags: 256
  161. -- line height: 12
  162. -- part name: Thanks
  163. ----- HyperTalk script -----
  164. on mouseDown
  165.   set visible of card field "Thanks" to false
  166. end mouseDown
  167.  
  168.  
  169. -- part 18 (button)
  170. -- low flags: 00
  171. -- high flags: A003
  172. -- rect: left=206 top=240 right=297 bottom=299
  173. -- title width / last selected line: 0
  174. -- icon id / first selected line: 15120 / 15120
  175. -- text alignment: 1
  176. -- font id: 0
  177. -- text size: 12
  178. -- style flags: 0
  179. -- line height: 16
  180. -- part name: Install Resources
  181. ----- HyperTalk script -----
  182. on mouseUp
  183.   answer "Install External Resources in the Home Stack?" with "Install" or "Cancel"
  184.   if it is "cancel" then exit mouseUp
  185.  
  186.   --This script comes from Stack Developer by Steve Drazga
  187.   --This script uses the ModResCopy XCMD.  Do you know who wrote it?
  188.   put (long name of this stack) into sourceStack
  189.   delete first word of sourceStack
  190.   delete first character of sourceStack
  191.   delete last character of sourceStack
  192.   put "Please select your HOME Stack."
  193.   put filename("STAK") into fname
  194.   if fname is empty then
  195.     hide message window
  196.     exit mouseup
  197.   end if
  198.   if sourcestack=fname then
  199.     beep 2
  200.     Answer "Sorry!  You can't install it in this stack"
  201.     hide message window
  202.     exit mouseup
  203.   end if
  204.  
  205.   --
  206.   set the cursor to 4
  207.   ModResCopy sourceStack,fname,"XFCN","FileName"
  208.   get the result
  209.   if first char of it is "E" then
  210.     put it into the message box
  211.     beep
  212.     answer "Attempt to install resource has failed."
  213.   end if
  214.   --
  215.  
  216.   ModResCopy sourceStack,fname,"XFCN","GetAppIcon"
  217.   get the result
  218.   if first char of it is "E" then
  219.     put it into the message box
  220.     beep
  221.     answer "Attempt to install resource has failed."
  222.   end if
  223.   --
  224.   ModResCopy sourceStack,fname,"XFCN","GetDocIcon"
  225.   get the result
  226.   if first char of it is "E" then
  227.     put it into the message box
  228.     beep
  229.     answer "Attempt to install resource has failed."
  230.   end if
  231.   --
  232.   ModResCopy sourceStack,fname,"XCMD","UpdateResFork"
  233.   get the result
  234.   if first char of it is "E" then
  235.     put it into the message box
  236.     beep
  237.     answer "Attempt to install resource has failed."
  238.   end if
  239.   --
  240.   if it is empty then
  241.     beep
  242.     answer "Resource installation successful"
  243.     hide message window
  244.   end if
  245.   Set visible of card field "last installed" to true
  246.   Set visible of card field "installed d/t" to true
  247.   put ConvertButtonName(fname) into shortName
  248.   put shortName&&"Stack" into line 2 of card field "last installed"
  249.   put the abbr time into line 1 of card field "installed D/T"
  250.   put the abbr date into line 2 of card field "installed D/T"
  251. end mouseUp
  252.  
  253. --by Steve Drazga and Stack Developer
  254.  
  255. function ConvertButtonName LongName
  256. put the length of LongName into nameLength
  257. repeat with x = nameLength down to 1
  258.   if char x of LongName = ":" then exit repeat
  259. end repeat
  260. return char (x + 1) to nameLength of LongName
  261. end ConvertButtonName
  262.  
  263.  
  264.  
  265.  
  266. -- part 15 (field)
  267. -- low flags: 81
  268. -- high flags: 2004
  269. -- rect: left=159 top=248 right=282 bottom=353
  270. -- title width / last selected line: 0
  271. -- icon id / first selected line: 0 / 0
  272. -- text alignment: 0
  273. -- font id: 3
  274. -- text size: 9
  275. -- style flags: 256
  276. -- line height: 12
  277. -- part name: HyperCard
  278. ----- HyperTalk script -----
  279. on mouseDown
  280.   set visible of card field "HyperCard" to not the visible of card field "HyperCard"
  281. end mouseDown
  282.  
  283.  
  284. -- part 16 (field)
  285. -- low flags: 81
  286. -- high flags: 2004
  287. -- rect: left=387 top=21 right=141 bottom=512
  288. -- title width / last selected line: 0
  289. -- icon id / first selected line: 0 / 0
  290. -- text alignment: 0
  291. -- font id: 3
  292. -- text size: 9
  293. -- style flags: 256
  294. -- line height: 12
  295. -- part name: resedit
  296. ----- HyperTalk script -----
  297. on mouseDown
  298.   set visible of card field "resedit" to not the visible of card field "resedit"
  299. end mouseDown
  300.  
  301.  
  302. -- part 17 (field)
  303. -- low flags: 81
  304. -- high flags: 2004
  305. -- rect: left=3 top=23 right=156 bottom=134
  306. -- title width / last selected line: 0
  307. -- icon id / first selected line: 0 / 0
  308. -- text alignment: 0
  309. -- font id: 3
  310. -- text size: 9
  311. -- style flags: 256
  312. -- line height: 12
  313. -- part name: resources
  314. ----- HyperTalk script -----
  315. on mouseDown
  316.   set visible of card field "resources" to not the visible of card field "resources"
  317. end mouseDown
  318.  
  319.  
  320. -- part 19 (field)
  321. -- low flags: 81
  322. -- high flags: 2002
  323. -- rect: left=53 top=251 right=283 bottom=189
  324. -- title width / last selected line: 0
  325. -- icon id / first selected line: 0 / 0
  326. -- text alignment: 1
  327. -- font id: 3
  328. -- text size: 9
  329. -- style flags: 256
  330. -- line height: 12
  331. -- part name: last installed
  332.  
  333.  
  334. -- part 20 (field)
  335. -- low flags: 81
  336. -- high flags: 2002
  337. -- rect: left=320 top=254 right=286 bottom=456
  338. -- title width / last selected line: 0
  339. -- icon id / first selected line: 0 / 0
  340. -- text alignment: 1
  341. -- font id: 3
  342. -- text size: 9
  343. -- style flags: 256
  344. -- line height: 12
  345. -- part name: installed D/T
  346.  
  347.  
  348. -- part contents for card part 3
  349. ----- text -----
  350. ICON Buttons Stack by Mark Spaulding, 1988
  351.  
  352. -- part contents for card part 6
  353. ----- text -----
  354.                                                      About ICON Buttons:
  355.           (Double-click on the word preceeding an asterisk for more information)
  356.  
  357.      Ever since HyperCard* was introduced, I have wanted to add buttons that would launch external applications.  This is simple enough, but assigning the 
  358. application‚Äôs ICN# to a button was a hassle.  Therefore, in order to simplify this process, I edited* the two scripts that are at the heart of this stack.
  359.  
  360.                               ‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢How the ‚ÄúIcon Button‚Äù Scripts work‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢
  361.  
  362.                                   ‚Ä¢‚Ä¢Making an External Application Button‚Ä¢‚Ä¢
  363.  
  364.      When you type ‚ÄúappButton‚Äù (without the quotes) into the message box from ANY stack, you will be prompted with a Standard Application Package dialogue box to select the application you would like to assgin‚Äîalong with its ICN#‚Äîto a HyperCard* Button.  A few seconds later, you will be presented with a application button with the application‚Äôs ICN# changed into a ICON resource type.  Simply drag the new button where you like, select the Browse Tool and Launch the external Application.
  365.  
  366.                                   ‚Ä¢‚Ä¢Making an External Document Button‚Ä¢‚Ä¢
  367.  
  368.      When you type ‚ÄúdocButton‚Äù (without the quotes) into the message box from ANY stack, you will be prompted with a Standard Application Package dialogue box to select the application  which generated the document you would like to assign to a HyperCard* button.  After completing the application selection, you will be presented with another Standard File Package dialogue box to select the Document‚Äîalong with its ICN#‚Äîto assign to a HyperCard Button.  A few seconds later, you will be presented with a Document button with the documents ICN# changed into a ICON resource type.  Simply drag the new button were you like, select the Browse Tool and Launch the external Document.
  369.  
  370.                              ‚Ä¢‚Ä¢‚Ä¢‚Ä¢How the ‚ÄúICON Button‚Äù Stack Works‚Ä¢‚Ä¢‚Ä¢‚Ä¢
  371.  
  372.      ‚ÄúICON Buttons‚Äù is similar to another Stack I designed ‚ÄúPower Tools*.‚Äù   However, unlike the ‚ÄúPower Tools*‚Äù stack, ‚ÄúICON Buttons‚Äù needs a few external resources*.  These resources* only need to be installed ONCE!  (Installation  is done by clicking the button below.  NOTE: A card field will be generated providing the date that the resources* were installed into the Home stack).  Even if you decide to remove the ‚ÄúICON Button‚Äù scripts, the resources* will not automatically be removed from your home Stack along with the ‚ÄúICON Button‚Äù scripts.  You must remove the resources* with a resource mover like ResEdit*.
  373.  
  374.      The ‚ÄúICON Buttons‚Äù stack will automatically install or remove the ‚ÄúICON Button‚Äù scripts at the click of a button (see the following card.)  Simply click the  ‚ÄúInstall ICON Buttons‚Äù button and this stack will do the rest.  If you decide to remove the ‚ÄúICON button‚Äù scripts, simply click the aforementioned button again and the stack will remove the ‚ÄúICON Button‚Äù scripts from your Home Stack.
  375.  
  376.                                                                                Enjoy and Thanks*,
  377.                                                                      Mark Spaulding*
  378.                                                                      GEnie: M-SPAULDING*
  379.  
  380.   
  381.  
  382.  
  383. -- part contents for card part 8
  384. ----- text -----
  385. edited
  386. Tools
  387. Spaulding
  388. Thanks
  389. HyperCard
  390. resedit
  391. resources
  392.  
  393. -- part contents for card part 9
  394. ----- text -----
  395. The basic design of the "ICON Buttons" scripts were taken from Stack Developer, by Steve Drazga. 
  396.  
  397. -- part contents for card part 11
  398. ----- text -----
  399.  I can be reached at:
  400. Yale Divinity School
  401. Box 279
  402. 409 Prospect Street
  403. New Haven, CT 06511
  404.  
  405. -- part contents for card part 12
  406. ----- text -----
  407. The Power Tools stack will install a script that will enable the user to access all HyperCard tools from the Key- board.   This stack can be found on GEnie.
  408.  
  409. -- part contents for card part 13
  410. ----- text -----
  411.      Special Thanks to:
  412.  
  413. Steve Drazga for Stack Developer and the hypertext technique.  Also for helping me with a bug in the scripts;
  414.                and
  415. J. Paul for GetAppIcon XFCN, GetDocIcon XFCN, & UpdateResFork XCMD;
  416. S. Maller for FileName XFCN;
  417. and whoever wrote ModResCopy XCMD;
  418. Mark Mendel for the basic script installer; and
  419. Jerry Daniels for the Crane ICON idea;
  420. and Paul Lee for testing.
  421.  
  422. I think that covers everybody!
  423.  
  424. -- part contents for card part 15
  425. ----- text -----
  426. Yes!  I know.   HyperCard‚Ñ¢ is a trade mark of Apple Computer¬Æ.
  427.  
  428. -- part contents for card part 16
  429. ----- text -----
  430. NOTE:  Steve Maller‚Äôs ResCopy XCMD will NOT allow you to access the Home Stack.  Therefore, you will need to use ResEdit, or Redit, or a similar application.
  431.  
  432. -- part contents for card part 17
  433. ----- text -----
  434. The external resources used in ICON Buttons are:
  435.  
  436. GetAppIcon XFCN, 
  437. GetDocIcon XFCN,UpdateResFork XCMD, by J. Paul.
  438. and FileName XFCN 
  439. by S. Maller.
  440.  
  441.  
  442. -- part contents for card part 19
  443. ----- text -----
  444. Resources installed in: